package com.alibaba.citrus.ots.sales.plan.repository;

import com.alibaba.citrus.ots.sales.plan.dto.api.request.BatchQuerySalesPlanRequest;
import com.alibaba.citrus.ots.sales.plan.dto.api.request.PageQuerySalePlanRequest;
import com.alibaba.citrus.ots.sales.plan.dto.api.request.QuerySalesPlanRequest;
import com.alibaba.citrus.ots.sales.plan.sdo.SalesPlanSDO;
import com.alibaba.cz.base.tool.page.PageResult;

import java.util.List;

/**
 * @author yuhailin
 * @description:
 * @date 2021-09-06 15:55
 */
public interface SalesPlanRepository {

    /**
     * 创建月度计划
     *
     * @param salesPlanSDO
     * @return
     */
    String save(SalesPlanSDO salesPlanSDO);

    /**
     * 编辑月度计划
     *
     * @param salesPlanSDO
     * @return
     */
    Boolean edit(SalesPlanSDO salesPlanSDO);

    /**
     * 分页查询月度计划
     *
     * @param pageQuerySalePlanRequest
     * @return
     */
    PageResult<List<SalesPlanSDO>> pageQuery(PageQuerySalePlanRequest pageQuerySalePlanRequest);

    /**
     * 根据id查询月度计划
     *
     * @param querySalesPlanRequest
     * @return
     */
    SalesPlanSDO load(QuerySalesPlanRequest querySalesPlanRequest);

    /**
     * 取消月度计划(状态变更-1)
     * 修改发布状态
     * 全量更新
     *
     * @param salesPlanSDO
     * @return
     */
    Integer updateSalesPlanStatus(SalesPlanSDO salesPlanSDO);

    /**
     * 编辑月度计划
     * 选择性更新
     *
     * @param salesPlanSDO
     * @return
     */
    Boolean editSalesPlan(SalesPlanSDO salesPlanSDO);

    /**
     * 根据条件获取最近月份的计划任务
     *
     * @param querySalesPlanRequest
     * @return
     */
    SalesPlanSDO loadLatelySalesPlan(QuerySalesPlanRequest querySalesPlanRequest);

    /**
     * 批量查询月度计划
     * @param batchQuerySalesPlanRequest
     * @return
     */
    List<SalesPlanSDO> batchQuerySalesPlan(BatchQuerySalesPlanRequest batchQuerySalesPlanRequest);


    /**
     * 获取当月以后的计划(包含当月)
     * @param querySalesPlanRequest
     * @return
     */
    List<SalesPlanSDO> loadLatelySalesPlans(QuerySalesPlanRequest querySalesPlanRequest);

}
